import upload from '@/utils/upload'
import request from '@/utils/request'

// 获取八字排盘信息
export const apiGetEight = (data) =>
	request({
		url: '/iching/getEight' + '?birth=' + data.birth + '&gender=' + data.gender,
		method: 'get'
	})

// 获取八字大运排盘信息
export const apiGetLucky = (data) => {
	let url = '/iching/getLucky' + '?birth=' + data.birth + '&gender=' + data.gender
	if (data.lucky !== null) {
		url += '&lucky=' + data.lucky
	}
	if (data.year !== null) {
		url += '&year=' + data.year
	}
	if (data.month !== null) {
		url += '&month=' + data.month
	}
	if (data.day !== null) {
		url += '&day=' + data.day
	}

	return request({
		url,
		method: 'get'
	})
}
// 获取当前年份全部流月流日
export const getFullYearMonthDays = (data) =>
	request({
		url: '/iching/getFullYearMonthDays' + '?year=' + data,
		method: 'get'
	})


// 保存收货地址
export function drawLots(data) {
	return request({
		url: '/iching/signDrawLots',
		method: 'get',
		params: data
	})
}
